package com.jnks.constant.enums;

import lombok.Getter;

/**
 * @author Ryo
 */
@Getter
public enum ViewTypeEnum {

    //默认库
    LAD("0",0,0,"lad"),
    //浙江
    ZHEJIANG("1",0,23,"zhejiang"),
    //安徽
    ANHUI("2",0,15,"anhui"),
    //福建
    FUJIAN("3",0,16,"fujian"),
    //甘肃
    GANSU("4",0,28,"gansu"),
    //广东
    GUANGDONG("5",0,3,"guangdong"),
    //海南
    HAINAN("6",0,18,"hannan"),
    //黑龙江
    HEILONGJIANG("7",0,5,"heilongjiang"),
    //湖南
    HUNAN("8",0,17,"hunan"),
    //江西
    JIANGXI("9",0,33,"jiangxi"),
    //吉林
    JILIN("10",0,32,"jilin"),
    //内蒙古
    NEIMENGGU("11",0,4,"neimenggu"),
    //宁夏
    NINGXIA("12",0,22,"nixia"),
    //山东
    SHANDONG("13",0,9,"shandong"),
    //新疆
    XINJIANG("14",0,6,"xinjiang"),
    //云南
    YUNNAN("15",0,31,"yunnan"),
    //北京
    BEIJING("16",0,34,"beijing");


    final String code;
    final int cityId;
    final int pid;
    final String desc;


    ViewTypeEnum(String code, int cityId, int pid, String desc){
        this.code = code;
        this.cityId = cityId;
        this.pid = pid;
        this.desc = desc;
    }





    public static int getPidValue(int  cid){
        for (ViewTypeEnum c : values()) {
            if(cid == c.cityId){
                return  c.pid;
            }
        }
        return 0;
    }



    public static String getDescValue(int  pid){
        for (ViewTypeEnum viewTypeEnum : values()) {
            if(pid == viewTypeEnum.pid){
                return  viewTypeEnum.getDesc();
            }
        }
        return null;
    }

    public static String getCodeValue(int  pid){
        for (ViewTypeEnum viewTypeEnum : values()) {
            if(pid == viewTypeEnum.pid){
                return  viewTypeEnum.getCode();
            }
        }
        return null;
    }


}
